<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('contract_payment_plan/list')}">收款计划</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="get" action="{:url('contract_payment_plan/list')}">
            客户名称|联系方式:
            <input type="text" class="form-control" name="customer" style="width: 150px;" value="{:input('request.customer/s','')}">
            合同编号:
            <input type="text" class="form-control" name="contract_no" style="width: 150px;" value="{:input('request.contract_no/s','')}">
            计划收款日期:
            <input type="text" class="form-control js-bootstrap-date" name="plan_date" style="width: 150px;" value="{:input('request.plan_date/s','')}">
            结清日期:
            <input type="text" class="form-control js-bootstrap-date" name="clear_date" style="width: 150px;" value="{:input('request.clear_date/s','')}">
            状态:
            <select name="status" class="form-control">
            	<option value=""></option>
            	<option value="1" <if input('status') == 1>selected</if> >未结清</option>
            	<option value="2" <if input('status') == 2>selected</if> >已结清</option>
            </select>
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:url('contract_payment_plan/list')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>合同</th>
					<th>客户</th>
					<th>计划收款日期</th>
					<th>应收款金额</th>
					<th>已收款金额</th>
					<th>未收款金额</th>
					<th>状态</th>
					<th>结清日期</th>
					<th width="200">{:lang('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="list" item="vo">
					<tr>
						<td>{$vo.id}</td>
						<td>{$vo.contract.contract_no}</td>
						<td>{$vo.contract.customer.name}|{$vo.contract.customer.mobile}</td>
						<td>{$vo.plan_date}</td>
						<td>{$vo.amount|floatval}</td>
						<td>{$vo.receive_amount|floatval}</td>
						<td>{$vo.amount-$vo.receive_amount|floatval}</td>
						<td>{$vo.status_text}</td>
						<td>{$vo.clear_date}</td>
						<td>
							<a class="btn btn-xs btn-primary" href="javascript:parent.openIframeLayer('{:url('contract_payment_receive/add',array('contract_id'=>$vo['contract_id'],'plan_id'=>$vo['id']))}','收款到账',{area:['30%','70%']});">收款到账</a>
							<a class="btn btn-xs btn-primary" href="javascript:parent.openIframeLayer('{:url('contract_payment_receive/record',array('contract_id'=>$vo['contract_id'],'plan_id'=>$vo['id']))}','收款记录',{area:['70%','70%']});">收款记录</a>
							<a class="btn btn-xs btn-primary" href='{:url("contract_payment_plan/edit",array("id"=>$vo["id"],"url_type"=>1))}'>{:lang('EDIT')}</a>
                        	<a class="btn btn-xs btn-danger js-ajax-delete" href='{:url("contract_payment_plan/delete",array("id"=>$vo["id"]))}'>{:lang('DELETE')}</a>
						</td>
					</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>